package com.fb;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.dev.GUI;
import com.dev.GUI.Item;
import com.dev.IconViewClose;
import com.dev.MainActivity;

public class QueryMoreSettings extends LinearLayout implements OnClickListener{
	WindowManager.LayoutParams wlp=new WindowManager.LayoutParams();
	MainActivity ma;
	Item itInertia;
	TextView title;
	LinearLayout titlebar;
	IconViewClose close;
    QueryMoreSettings(MainActivity ma){
		super(ma);
		this.ma=ma;
		setOrientation(1);
		setBackground(new GUI.BorderDrawable());
		int padding=10;
		int textSize=(int)(13*ma.dp);
		close=new IconViewClose(ma);
		close.setOnClickListener(this);
		title=new TextView(ma);
		title.setText("页面设置");
		title.setGravity(Gravity.CENTER_VERTICAL);
		title.getPaint().setTextSize(textSize);
		titlebar=new LinearLayout(ma);
		titlebar.setOrientation(0);
		titlebar.setBackground(new GUI.BorderDrawable());
		titlebar.setPadding(padding,0,padding,0);
		titlebar.addView(title,new LayoutParams(0,-1,1f));
		titlebar.addView(close);
		itInertia=new Item(ma);
		itInertia.setText("惯性滚动");
		itInertia.setOnClickListener(this);
		LinearLayout.LayoutParams itlp=new LinearLayout.LayoutParams(-1,ma.dialogTitleBarHeight);
		addView(titlebar,-1,ma.dialogTitleBarHeight);
		addView(itInertia,itlp);
	}
	void show(){
		wlp.width=ma.wp/2;
		wlp.height=-2;
		ma.wm.addView(this,wlp);
	}
	void dismiss(){
		ma.wm.removeView(this);
	}
	@Override
	public void onClick(View view) {
		if(view==close){
			dismiss();
		}
	}
}
